import { handleNumber, handleNumberColor } from "@/utils/util"

const columns = (newFormat: (arg: string) => string) => {
	return {
		acctName: {
			title: newFormat("funds.fund_audit.account_number"),
			dataIndex: "acctName",
			width: 180,
			align: "center"
		},
		// todo acctType === 99
		acctType: {
			title: newFormat("funds.fund_audit.proxy_level"),
			dataIndex: "acctType",
			width: 120,
			align: "center",
			render: (text: number) => {
				if (text === 99) {
					return "会员"
				}
				return text
			}
		},
		topMerchantName: {
			title: newFormat("common.belong_merchant"),
			dataIndex: "topMerchantName",
			width: 180,
			align: "center"
		},
		acctStatus: {
			title: newFormat("common.account_status"),
			dataIndex: "acctStatus",
			width: 100,
			align: "center",
			render: (accStatus: number) => {
				if (accStatus === 1) {
					return <span className="disableRgba">{newFormat("common.login_lock_statu")}</span>
				}
				if (accStatus === 0) {
					return <span className="normalRgba">{newFormat("common.account_status_normal")}</span>
				}

				return "-"
			}
		},
		teamFunds: {
			title: newFormat("funds.settlement_bill_management.team_assets"),
			dataIndex: "teamFunds",
			width: 200,
			align: "center",
			// render: (text: string) => handleTotalNumber("$", "USDT", text)
			render: (text: number) => <span style={{ color: handleNumberColor(text) }}>{handleNumber("$", String(text))}</span>
		},
		clubRebateAmount: {
			title: newFormat("funds.history_settlement_bill_management.club_rebate_amount"),
			dataIndex: "clubRebateAmount",
			width: 200,
			align: "center",
			render: (text: number) => <span>{handleNumber("$", String(text))}</span>
		},
		insuranceRebateAmount: {
			title: newFormat("funds.history_settlement_bill_management.insurance_rebate_amount"),
			dataIndex: "insuranceRebateAmount",
			width: 200,
			align: "center",
			render: (text: number) => <span>{handleNumber("$", String(text))}</span>
			// render: renderNullableValue("insuranceRebateAmount", "$")
		},
		multipleRebateAmount: {
			title: newFormat("funds.history_settlement_bill_management.multiple_rebate_amount"),
			dataIndex: "multipleRebateAmount",
			width: 200,
			align: "center",
			render: (text: number) => <span>{handleNumber("$", String(text))}</span>
		},
		teamIncomeAmount: {
			title: newFormat("funds.history_settlement_bill_management.team_income_amount"),
			dataIndex: "teamIncomeAmount",
			width: 200,
			align: "center",
			render: (text: number) => <span>{handleNumber("$", String(text))}</span>
		},
		multipleRebateAmountRate: {
			title: newFormat("funds.history_settlement_bill_management.multiple_rebate_amount_rate"),
			dataIndex: "multipleRebateAmountRate",
			width: 200,
			align: "center",
			render: (text: number) => <span>{handleNumber("$", String(text))}</span>
		},
		teamRebateSharing: {
			title: newFormat("funds.history_settlement_bill_management.team_rebate_sharing"),
			dataIndex: "teamRebateSharing",
			width: 200,
			align: "center",
			render: (text: number) => <span>{handleNumber("$", String(text))}</span>
		},
		netAssets: {
			title: newFormat("funds.history_settlement_bill_management.net_assets"),
			dataIndex: "netAssets",
			width: 200,
			align: "center",
			render: (text: number) => <span style={{ color: handleNumberColor(text) }}>{handleNumber("$", String(text))}</span>
		},
		withdrawable: {
			title: newFormat("funds.history_settlement_bill_management.with_drawable"),
			dataIndex: "withdrawable",
			width: 200,
			align: "center",
			render: (text: number) => <span>{handleNumber("$", String(text))}</span>
		},
		shouldRepay: {
			title: newFormat("funds.history_settlement_bill_management.should_repay"),
			dataIndex: "shouldRepay",
			width: 200,
			align: "center",
			render: (text: number) => <span>{handleNumber("$", String(text))}</span>
		},
		outsideAmount: {
			title: newFormat("funds.history_settlement_bill_management.outside_amount"),
			dataIndex: "outsideAmount",
			width: 200,
			align: "center",
			render: (text: number) => <span>{handleNumber("$", String(text))}</span>
		},
		totalCreditAmount: {
			title: newFormat("funds.history_settlement_bill_management.total_credit_amount"),
			dataIndex: "totalCreditAmount",
			width: 200,
			align: "center",
			render: (text: number) => <span>{handleNumber("$", String(text))}</span>
		},
		agencyPersonalIncome: {
			title: newFormat("funds.history_settlement_bill_management.agency_personal_income"),
			dataIndex: "agencyPersonalIncome",
			width: 200,
			align: "center",
			render: (text: number) => <span>{handleNumber("$", String(text))}</span>
		},
		memberDepositAmount: {
			title: newFormat("funds.history_settlement_bill_management.member_deposit_amount"),
			dataIndex: "memberDepositAmount",
			width: 200,
			align: "center",
			render: (text: number) => <span>{handleNumber("$", String(text))}</span>
		},
		memberWithdrawAmount: {
			title: newFormat("funds.history_settlement_bill_management.member_with_draw_amount"),
			dataIndex: "memberWithdrawAmount",
			width: 200,
			align: "center",
			render: (text: number) => <span>{handleNumber("$", String(text))}</span>
		},
		memberLoan: {
			title: newFormat("funds.history_settlement_bill_management.member_loan"),
			dataIndex: "memberLoan",
			width: 200,
			align: "center",
			render: (text: number) => <span>{handleNumber("$", String(text))}</span>
		},
		memberRepayment: {
			title: newFormat("funds.history_settlement_bill_management.member_repayment"),
			dataIndex: "memberRepayment",
			width: 200,
			align: "center",
			render: (text: number) => <span>{handleNumber("$", String(text))}</span>
		}
	}
}

export default columns
